<div class="layui-hide-xs"> 
   <div class="fly-panel fly-column"> 
    <div class="layui-container"> 
     <ul class="layui-clear"> 
      <li class="layui-hide-xs "><a href="/">首页</a></li> 
      <li> <a href="/column/quiz/"> 提问 </a> </li> 
      <li> <a href="/column/share/"> 分享 <span class="layui-badge-dot"></span> </a> </li> 
      <li> <a href="/column/discuss/"> 讨论 </a> </li> 
      <li> <a href="/column/suggest/"> 建议 </a> </li> 
      <li> <a href="/column/notice/"> 公告 </a> </li> 
      <li> <a href="/column/news/"> 动态 </a> </li> 
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><span class="fly-mid"></span></li> 
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/user/post/">我发表的贴</a></li> 
      <li class="layui-hide-xs layui-hide-sm layui-show-md-inline-block"><a href="/user/post/#collection">我收藏的贴</a></li> 
     </ul> 
     <div class="fly-column-right layui-hide-xs"> 
      <span class="fly-search LAY_search"><i class="layui-icon"></i></span> 
      <a href="/jie/add/" class="layui-btn">发表新帖</a> 
     </div> 
     <div class="layui-hide-sm layui-show-xs-block" style="margin-top: -10px; padding-bottom: 10px; text-align: center;"> 
      <a href="/jie/add/" class="layui-btn">发表新帖</a> 
     </div> 
    </div>
   </div>
  </div>
  <div class="layui-container"> 
   <div class="layui-row layui-col-space15"> 
    <div class="layui-col-md8 content detail"> 
     <div class="fly-panel detail-box"> 
      <h1>{$data.title}</h1> 
      <div class="fly-detail-info"> 
       <span class="layui-badge layui-bg-green fly-detail-column"> {$data.cate_name} </span>
       {if condition='$data.status'}
        <span class="layui-badge" style="background-color: #5FB878;">已结</span>
       {else/}
        <span class="layui-badge" style="background-color: #999;">未结</span>
       {/if}
       <div class="fly-admin-box" data-id="43262"> 
       </div> 
       <span class="fly-list-nums"> <a href="#comment"><i class="iconfont" title="回答"></i> {$data.reply_num}</a> <i class="iconfont" title="人气"></i> {$data.view_num}</span> 
      </div> 
      <div class="detail-about"> 
       <a class="fly-avatar" href="/u/25570776/"> <img src="__ROOT__/{$data.face}" alt="戴帽子的猫" /> </a> 
       <div class="fly-detail-user"> 
        <a href="/u/25570776/" class="fly-link"> <cite>{$data.nickname}</cite> </a> 
        <span>{:Ftime($data.create_time)}</span> 
       </div> 
       <div class="detail-hits" id="LAY_jieAdmin" data-id="43262"> 
        <span style="padding-right: 10px; color: #FF7200">悬赏：{$data.kiss}飞吻</span>
  
        {if condition="$data.collect_id"}
        <span class="layui-btn layui-btn-xs jie-admin collect layui-btn-danger" type="collect" data-type="add" question_id={$data.question_id}>取消收藏</span>
        {else/}
        <span class="layui-btn layui-btn-xs jie-admin collect" type="collect" data-type="add" question_id={$data.question_id}>收藏</span>
        {/if}        
       </div> 
      </div> 
      <div class="detail-body layui-text photos">
      {if condition="$data.ext_info"}
       <table class="layui-table"> 
        <tbody> 
         <tr> 
          <td>版本：{$data.ext_info.project} |{$data.ext_info.version} </td> 
          <td>浏览器：{$data.ext_info.browser}</td> 
         </tr> 
        </tbody> 
       </table>
       {/if}
       {$data.content}
      </div> 
     </div> 
     <a name="top"></a>
     <div class="fly-panel detail-box" id="flyReply"> 
      
      <fieldset class="layui-elem-field layui-field-title" style="text-align: center;"> 
       <legend>回帖</legend> 
      </fieldset> 
      <ul class="jieda" id="jieda">
        {volist name="replyData" id="reply"}
       <li data-id="145527"> <a name="item-1541062303334"></a> 
        <div class="detail-about detail-about-reply"> 
         <a class="fly-avatar" href="/u/16633176/"> <img src="__ROOT__/{$reply.face}" alt="花季岁月" /> </a> 
         <div class="fly-detail-user"> 
          <a href="/u/16633176/" class="fly-link"> <cite>{$reply.nickname}</cite> </a> 
         </div> 
         <div class="detail-hits"> 
          <span>{:Ftime($reply.create_time)}</span> 
         </div> 
        </div> 
        <div class="detail-body layui-text jieda-body photos"> 
          {$reply.content}
        </div> 
        <div class="jieda-reply"> 
         <span class="jieda-zan {$reply.good_id ?'zanok':''}" reply="{$reply.reply_id}" type="zan"> <i class="iconfont icon-zan"></i> <em>{$reply.zan_num}</em> </span> 
         <span type="reply" class="reply" nickname="{$reply.nickname}"> <i class="iconfont icon-svgmoban53"></i> 回复 </span> 
        </div>
       </li>
       {/volist}
      </ul> 
      <div style="text-align: center"> 
      </div> 
      <a name="comment"> </a> 
      <div class="layui-form layui-form-pane"> 
       <form action="/jie/reply/" method="post"> 
        <div class="layui-form-item layui-form-text"> 
         <div class="layui-input-block">
          <textarea id="content" name="content" required=""  placeholder="请输入内容" class="layui-textarea fly-editor" style="height: 150px;"></textarea> 
         </div> 
        </div> 
        <div class="layui-form-item"> 
         <input type="hidden" name="question_id" value="{$data.question_id}" /> 
         <button class="layui-btn" lay-filter="reply" lay-submit="">提交回复</button> 
        </div> 
       </form> 
      </div> 
     </div> 
    </div> 
    <div class="layui-col-md4"> 
     {include file="hot" /}
     <div class="fly-panel"> 
      <div class="fly-panel-title">
        心级赞助商 
       <span style="padding: 0 3px;">-</span> 
       <a href="/jie/15697/" class="fly-link fly-joinad    ">我要加入</a> 
      </div> 
      <div class="fly-panel-main"> 
       <a href="https://www.larryms.com/cates/5.html" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #64BF98;" time-limit="2018-11-06 0:0:0"> 60秒极速上手，layui案例排名NO1后台框架 </a> 
       <a href="https://yunzhuji.shop/url/?t=s11t&amp;utm_source=fly" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #FF0000;" time-limit="2018-11-05 0:0:0"> 阿里云双11拼团低至99元，瓜分百万红包 </a> 
       <a href="https://www.renren.io/layui" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #4BAE4F;" time-limit="2019-09-08 0:0:0"> 人人开源 - 企业级后台脚手架框架 </a> 
       <a href="https://www.9xkd.com/land/layui.html" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: #FA7D5F;" time-limit="2018-11-05 0:0:0">诚邀你来侠课岛短视频学习全栈开发</a> 
      </div>
     </div> 
     <div class="fly-panel"> 
      <div class="fly-panel-title">
        官方产品 
      </div> 
      <div class="fly-panel-main"> 
       <a href="http://www.layui.com/admin/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #20222A; background-image: linear-gradient(to right,#20222A,#3E4251);">layuiAdmin - layui 官方后台管理模板</a> 
       <a href="http://layim.layui.com/?from=fly" target="_blank" class="fly-zanzhu" time-limit="2017.09.25-2099.01.01" style="background-color: #009688; background-image: linear-gradient(to right,#009688,#5FB878);">LayIM - layui 即时通讯旗舰之作</a> 
      </div>
     </div> 
     <div class="fly-panel" style="padding: 20px 0; text-align: center;"> 
      <img src="//cdn.layui.com/upload/2017_8/168_1501894831075_19619.jpg" style="max-width: 100%;" alt="layui" /> 
      <p style="position: relative; color: #666;">微信扫码关注 layui 公众号</p> 
     </div> 
    </div> 
   </div>
  </div>
  <script>
  //Demo
  layui.use(['form','layedit'], function(){
    var form = layui.form;
    var layedit = layui.layedit;

    $('.reply').click(function(event) {
      window.location.hash = '';

      nickname = $(this).attr('nickname');

      window.location.hash = "#comment"; 

      layedit.setContent(edit,"@"+nickname);

    });

    layedit.set({
      uploadImage: {
        url: '{:url('index/jie/upload')}' //接口url
        ,type: '' //默认post
      }
    });

    edit = layedit.build('content',{height: 150}); //建立编辑器
    
    //监听提交
    form.on('submit(reply)', function(data){
      // layer.msg(JSON.stringify(data.field));
      data.field.content = layedit.getContent(edit);

      $.post('{:url('index/jie/reply')}', data.field, function(res, textStatus, xhr) {
        if(res.code==0){
          layer.msg(res.msg,function(){});
        }else{
          layer.alert(res.msg,function () {
            layer.closeAll();
            // console.log(location);
            location.reload();
            location.assign(location.pathname+"#top");

          })
        }
      },'json');
      return false;
    });

    $('.collect').click(function(event) {
        question_id = $(this).attr('question_id');

        $.post('{:url('index/jie/collect')}', {question_id:question_id}, function(res, textStatus, xhr) {
          if(res.code==0){
            layer.msg(res.msg,function(){});
          }else{
            layer.msg(res.msg,{icon:6});
            if(res.msg=="收藏成功"){
              $('.collect').addClass('layui-btn-danger').html('取消收藏');

            }else{
              $('.collect').removeClass('layui-btn-danger').html('收藏');
            }
          }
        },'json');
    });

    $('.jieda-zan').click(function(event) {
        reply_id = $(this).attr('reply');

        that = $(this);

        $.post('{:url('index/jie/zan')}', {reply_id:reply_id}, function(res, textStatus, xhr) {
          if(res.code==0){
            layer.msg(res.msg,function(){});
          }else{
            layer.msg(res.msg,{icon:6});
            if(res.msg=="点赞成功"){
              that.addClass('zanok');
              num = that.children('em').text();
              num++
              that.children('em').text(num)
            }else{
              that.removeClass('zanok');
              num = that.children('em').text();
              num--
              that.children('em').text(num)
            }
          }
        },'json');
    });
  });
  </script>